<?php /* Smarty version 2.6.26, created on 2018-07-25 15:09:42
         compiled from E:%5CWWW%5C40.125.208.171%5Cvweb/member%5Ctemplates/goods/edit.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'import', 'E:\\WWW\\40.125.208.171\\vweb/member\\templates/goods/edit.html', 1, false),array('modifier', 'in_array', 'E:\\WWW\\40.125.208.171\\vweb/member\\templates/goods/edit.html', 64, false),array('modifier', 'img_size', 'E:\\WWW\\40.125.208.171\\vweb/member\\templates/goods/edit.html', 80, false),)), $this); ?>
<?php echo $this->_plugins['function']['import'][0][0]->import(array('file' => "index/header_shop.html",'title' => "产品编辑"), $this);?>
 
<link href="<?php echo $this->_tpl_vars['__APP__']; ?>
public/css/goods_edit.css" rel="stylesheet" type="text/css">  
<form id="form" method="post"> 
	<?php if ($this->_tpl_vars['row']['id']): ?><input type="hidden" name="id" value="<?php echo $this->_tpl_vars['row']['id']; ?>
" id="goods_id"/><?php endif; ?>
	<?php if ($_GET['cid']): ?>	
		<input type="hidden" name="cid" value="<?php echo $_GET['cid']; ?>
"/>
	<?php else: ?>
		<input type="hidden" name="cid" value="<?php echo $this->_tpl_vars['row']['cid']; ?>
"/>
	<?php endif; ?>
	<table width="100%" class="etable"> 
		<tr>
			<td width="80">产品分类：</td>
			<td style="text-align:left;">
			<div class="cats_box">
				<?php $_from = $this->_tpl_vars['cats']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['ck'] => $this->_tpl_vars['c']):
?>
					<?php echo $this->_tpl_vars['c']; ?>
 >>
				<?php endforeach; endif; unset($_from); ?>
				<a href="?m=goods&a=chose_cats&gid=<?php echo $this->_tpl_vars['row']['id']; ?>
&cid=<?php if ($this->_tpl_vars['row']['cid'] == ''): ?><?php echo $_GET['cid']; ?>
<?php else: ?><?php echo $this->_tpl_vars['row']['cid']; ?>
<?php endif; ?>" onClick="returns edit_cats();">编辑</a></td>
			</div>
		</tr>
		<tr>
			<td>商品名：</td>
			<td><input type="text" name="title" class="edit" size="78" id="title" value="<?php echo $this->_tpl_vars['row']['title']; ?>
"/> <i>*</i></td>
		</tr>
		<tr>
			<td style="padding-top:10px;" valign="top">卖点介绍：</td>
			<td><textarea name="intro" class="edit" cols="80" rows="3" class="h5_round" id="intro"><?php echo $this->_tpl_vars['row']['intro']; ?>
</textarea></td>
		</tr> 
		<tr>
			<td>店铺分类：</td>
			<td>
				<select name="group_cid">
					<option value="0">店铺产品分类</option>
					<?php if ($this->_tpl_vars['goods_group']): ?>
						<?php $_from = $this->_tpl_vars['goods_group']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['i']):
?>
							<option value="<?php echo $this->_tpl_vars['i']['id']; ?>
" <?php if ($this->_tpl_vars['row']['group_cid'] == $this->_tpl_vars['i']['id']): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['i']['name']; ?>
</option> 
						<?php endforeach; endif; unset($_from); ?>
					<?php endif; ?>
				</select>
			</td>
		</tr> 
		<tr>
			<td>所属品牌：</td>
			<td>
				<select name="brand">
					<option value="0">选择品牌</option> 
					<?php unset($this->_sections['b']);
$this->_sections['b']['name'] = 'b';
$this->_sections['b']['loop'] = is_array($_loop=$this->_tpl_vars['brand']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['b']['show'] = true;
$this->_sections['b']['max'] = $this->_sections['b']['loop'];
$this->_sections['b']['step'] = 1;
$this->_sections['b']['start'] = $this->_sections['b']['step'] > 0 ? 0 : $this->_sections['b']['loop']-1;
if ($this->_sections['b']['show']) {
    $this->_sections['b']['total'] = $this->_sections['b']['loop'];
    if ($this->_sections['b']['total'] == 0)
        $this->_sections['b']['show'] = false;
} else
    $this->_sections['b']['total'] = 0;
if ($this->_sections['b']['show']):

            for ($this->_sections['b']['index'] = $this->_sections['b']['start'], $this->_sections['b']['iteration'] = 1;
                 $this->_sections['b']['iteration'] <= $this->_sections['b']['total'];
                 $this->_sections['b']['index'] += $this->_sections['b']['step'], $this->_sections['b']['iteration']++):
$this->_sections['b']['rownum'] = $this->_sections['b']['iteration'];
$this->_sections['b']['index_prev'] = $this->_sections['b']['index'] - $this->_sections['b']['step'];
$this->_sections['b']['index_next'] = $this->_sections['b']['index'] + $this->_sections['b']['step'];
$this->_sections['b']['first']      = ($this->_sections['b']['iteration'] == 1);
$this->_sections['b']['last']       = ($this->_sections['b']['iteration'] == $this->_sections['b']['total']);
?>
						<option value="<?php echo $this->_tpl_vars['brand'][$this->_sections['b']['index']]['id']; ?>
" <?php if ($this->_tpl_vars['row']['brand'] == $this->_tpl_vars['brand'][$this->_sections['b']['index']]['id']): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['brand'][$this->_sections['b']['index']]['name']; ?>
</option> 
					<?php endfor; endif; ?>
				</select>
			</td>
		</tr> 
	<?php if ($this->_tpl_vars['attr']): ?>		
		<tr>
			<td style=" padding-top:10px;" valign="top">产品属性：</td>
			<td> 
				<div class="attr">
				<?php unset($this->_sections['a']);
$this->_sections['a']['name'] = 'a';
$this->_sections['a']['loop'] = is_array($_loop=$this->_tpl_vars['attr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['a']['show'] = true;
$this->_sections['a']['max'] = $this->_sections['a']['loop'];
$this->_sections['a']['step'] = 1;
$this->_sections['a']['start'] = $this->_sections['a']['step'] > 0 ? 0 : $this->_sections['a']['loop']-1;
if ($this->_sections['a']['show']) {
    $this->_sections['a']['total'] = $this->_sections['a']['loop'];
    if ($this->_sections['a']['total'] == 0)
        $this->_sections['a']['show'] = false;
} else
    $this->_sections['a']['total'] = 0;
if ($this->_sections['a']['show']):

            for ($this->_sections['a']['index'] = $this->_sections['a']['start'], $this->_sections['a']['iteration'] = 1;
                 $this->_sections['a']['iteration'] <= $this->_sections['a']['total'];
                 $this->_sections['a']['index'] += $this->_sections['a']['step'], $this->_sections['a']['iteration']++):
$this->_sections['a']['rownum'] = $this->_sections['a']['iteration'];
$this->_sections['a']['index_prev'] = $this->_sections['a']['index'] - $this->_sections['a']['step'];
$this->_sections['a']['index_next'] = $this->_sections['a']['index'] + $this->_sections['a']['step'];
$this->_sections['a']['first']      = ($this->_sections['a']['iteration'] == 1);
$this->_sections['a']['last']       = ($this->_sections['a']['iteration'] == $this->_sections['a']['total']);
?>
					<div class="attr_box">
						<span><?php echo $this->_tpl_vars['attr'][$this->_sections['a']['index']]['name']; ?>
</span> 
						<select name="attr[]">
							<option value="0">请选择</option> 
							<?php unset($this->_sections['p']);
$this->_sections['p']['name'] = 'p';
$this->_sections['p']['loop'] = is_array($_loop=$this->_tpl_vars['attr'][$this->_sections['a']['index']]['p_attr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['p']['show'] = true;
$this->_sections['p']['max'] = $this->_sections['p']['loop'];
$this->_sections['p']['step'] = 1;
$this->_sections['p']['start'] = $this->_sections['p']['step'] > 0 ? 0 : $this->_sections['p']['loop']-1;
if ($this->_sections['p']['show']) {
    $this->_sections['p']['total'] = $this->_sections['p']['loop'];
    if ($this->_sections['p']['total'] == 0)
        $this->_sections['p']['show'] = false;
} else
    $this->_sections['p']['total'] = 0;
if ($this->_sections['p']['show']):

            for ($this->_sections['p']['index'] = $this->_sections['p']['start'], $this->_sections['p']['iteration'] = 1;
                 $this->_sections['p']['iteration'] <= $this->_sections['p']['total'];
                 $this->_sections['p']['index'] += $this->_sections['p']['step'], $this->_sections['p']['iteration']++):
$this->_sections['p']['rownum'] = $this->_sections['p']['iteration'];
$this->_sections['p']['index_prev'] = $this->_sections['p']['index'] - $this->_sections['p']['step'];
$this->_sections['p']['index_next'] = $this->_sections['p']['index'] + $this->_sections['p']['step'];
$this->_sections['p']['first']      = ($this->_sections['p']['iteration'] == 1);
$this->_sections['p']['last']       = ($this->_sections['p']['iteration'] == $this->_sections['p']['total']);
?>
								<option value="<?php echo $this->_tpl_vars['attr'][$this->_sections['a']['index']]['p_attr'][$this->_sections['p']['index']]['id']; ?>
"<?php if ($this->_tpl_vars['row']['id']): ?><?php if (((is_array($_tmp=$this->_tpl_vars['attr'][$this->_sections['a']['index']]['p_attr'][$this->_sections['p']['index']]['id'])) ? $this->_run_mod_handler('in_array', true, $_tmp, $this->_tpl_vars['selected_attr']) : in_array($_tmp, $this->_tpl_vars['selected_attr']))): ?> selected="selected"<?php endif; ?><?php endif; ?>><?php echo $this->_tpl_vars['attr'][$this->_sections['a']['index']]['p_attr'][$this->_sections['p']['index']]['name']; ?>
</option> 
							<?php endfor; endif; ?>
						</select>
					</div>
				<?php endfor; endif; ?>
				</div>
			</td>
		</tr>
	<?php endif; ?>
		<tr>
			<td style="padding-top:10px;" valign="top">展示主图：</td>
			<td class="upload_hd_img">
				<div class="show_hd_img">
					<?php if ($this->_tpl_vars['img_data']): ?>	
						<?php $_from = $this->_tpl_vars['img_data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['img']):
?>		 
							<div class="show_img">  
								<img src="<?php echo $this->_tpl_vars['__IMG__']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['img']['url'])) ? $this->_run_mod_handler('img_size', true, $_tmp, '80x80') : $this->_plugins['modifier']['img_size'][0][0]->img_size($_tmp, '80x80')); ?>
"/> 
								<span><img src="<?php echo $this->_tpl_vars['__PUBLIC__']; ?>
images/icon/del.png" /></span>
								<input type="hidden" value="<?php echo $this->_tpl_vars['img']['url']; ?>
" id="goods_img" name="goods_img[]">
								<input type="hidden" value="<?php echo $this->_tpl_vars['img']['px']; ?>
" name="goods_img_px[]" class="goods_img_px">
							</div>
						<?php endforeach; endif; unset($_from); ?>
					<?php else: ?>
						<div class="no_img"></div>
					<?php endif; ?>	
				</div>
				<div class="upload_album"><a href="javascript:;" onclick="upload_manage('head_img','',true)">上传图片</a></div>
				<div class="prompt">建议尺寸：640 x 640 像素；最多可以上传5张图片；</div>
			</td>
		</tr>
	
		<!---------SKU--------->  
		<tr>
			<td style="padding-top:10px;" valign="top">库存/规格：</td>
			<td>
				<div class="skuBig">	
					<div id="sku_checkbox">
						<?php unset($this->_sections['s']);
$this->_sections['s']['name'] = 's';
$this->_sections['s']['loop'] = is_array($_loop=$this->_tpl_vars['sku']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['s']['show'] = true;
$this->_sections['s']['max'] = $this->_sections['s']['loop'];
$this->_sections['s']['step'] = 1;
$this->_sections['s']['start'] = $this->_sections['s']['step'] > 0 ? 0 : $this->_sections['s']['loop']-1;
if ($this->_sections['s']['show']) {
    $this->_sections['s']['total'] = $this->_sections['s']['loop'];
    if ($this->_sections['s']['total'] == 0)
        $this->_sections['s']['show'] = false;
} else
    $this->_sections['s']['total'] = 0;
if ($this->_sections['s']['show']):

            for ($this->_sections['s']['index'] = $this->_sections['s']['start'], $this->_sections['s']['iteration'] = 1;
                 $this->_sections['s']['iteration'] <= $this->_sections['s']['total'];
                 $this->_sections['s']['index'] += $this->_sections['s']['step'], $this->_sections['s']['iteration']++):
$this->_sections['s']['rownum'] = $this->_sections['s']['iteration'];
$this->_sections['s']['index_prev'] = $this->_sections['s']['index'] - $this->_sections['s']['step'];
$this->_sections['s']['index_next'] = $this->_sections['s']['index'] + $this->_sections['s']['step'];
$this->_sections['s']['first']      = ($this->_sections['s']['iteration'] == 1);
$this->_sections['s']['last']       = ($this->_sections['s']['iteration'] == $this->_sections['s']['total']);
?> 
							<div class="sku_con">
								<div class="sku_name"><span><?php echo $this->_tpl_vars['sku'][$this->_sections['s']['index']]['name']; ?>
</span></div>
								<div class="sku_detail">
							<?php unset($this->_sections['p']);
$this->_sections['p']['name'] = 'p';
$this->_sections['p']['loop'] = is_array($_loop=$this->_tpl_vars['sku'][$this->_sections['s']['index']]['p_sku']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['p']['show'] = true;
$this->_sections['p']['max'] = $this->_sections['p']['loop'];
$this->_sections['p']['step'] = 1;
$this->_sections['p']['start'] = $this->_sections['p']['step'] > 0 ? 0 : $this->_sections['p']['loop']-1;
if ($this->_sections['p']['show']) {
    $this->_sections['p']['total'] = $this->_sections['p']['loop'];
    if ($this->_sections['p']['total'] == 0)
        $this->_sections['p']['show'] = false;
} else
    $this->_sections['p']['total'] = 0;
if ($this->_sections['p']['show']):

            for ($this->_sections['p']['index'] = $this->_sections['p']['start'], $this->_sections['p']['iteration'] = 1;
                 $this->_sections['p']['iteration'] <= $this->_sections['p']['total'];
                 $this->_sections['p']['index'] += $this->_sections['p']['step'], $this->_sections['p']['iteration']++):
$this->_sections['p']['rownum'] = $this->_sections['p']['iteration'];
$this->_sections['p']['index_prev'] = $this->_sections['p']['index'] - $this->_sections['p']['step'];
$this->_sections['p']['index_next'] = $this->_sections['p']['index'] + $this->_sections['p']['step'];
$this->_sections['p']['first']      = ($this->_sections['p']['iteration'] == 1);
$this->_sections['p']['last']       = ($this->_sections['p']['iteration'] == $this->_sections['p']['total']);
?> 
								<label><input class="sku_checkbox" type="checkbox" name="sku_val" value="<?php echo $this->_tpl_vars['sku'][$this->_sections['s']['index']]['p_sku'][$this->_sections['p']['index']]['id']; ?>
"  <?php if ($this->_tpl_vars['row']['id']): ?><?php if (in_array($this->_tpl_vars['sku'][$this->_sections['s']['index']]['p_sku'][$this->_sections['p']['index']]['id'], $this->_tpl_vars['checked_sku'])): ?>checked="checked"<?php endif; ?><?php endif; ?>><?php echo $this->_tpl_vars['sku'][$this->_sections['s']['index']]['p_sku'][$this->_sections['p']['index']]['name']; ?>
</label>
							<?php endfor; endif; ?>
								</div>
							</div> 
						<?php endfor; endif; ?>
					</div>
					<div id="sku_color_img"><?php echo $this->_tpl_vars['goods_sku_images']; ?>
</div>
					<div id="sku_list"><?php echo $this->_tpl_vars['goods_sku_list']; ?>
</div>
				</div>
			</td> 
		</tr>
		
		<!----------SKU---------->   
		<tr>
			<td>一口价：</td>
			<td class="td_price">
				<input type="text" name="price" class="edit" size="8" id="price" value="<?php echo $this->_tpl_vars['row']['price']; ?>
"/>  
				<div class="price_market">
					<span>总库存：</span>
					<input type="text" name="stock" class="edit" size="8" id="stock" value="<?php echo $this->_tpl_vars['row']['stock']; ?>
"/><i>*</i> 
				</div>  
				<div class="price_market">
					<span>条形码：</span>
					<input type="text" name="code" class="edit" size="15" id="code" value="<?php echo $this->_tpl_vars['row']['code']; ?>
"/><i>*</i> 
				</div> 
			</td>
		</tr> 
		<tr>
			<td>市场价：</td>
			<td><input type="text" name="market_price" class="edit" size="8" id="market_price" value="<?php echo $this->_tpl_vars['row']['market_price']; ?>
"/><i>*</i></td>
		</tr> 
		<tr> 
			<td valign="top" style="padding-top:10px;">产品详情：</td>
			<td><textarea name="content" rows="30" style="width:820px;"><?php echo $this->_tpl_vars['row']['content']; ?>
</textarea> </td>
		</tr>
		<tr>
			<td>运费：</td>
			<td> 
				<select name="express">
				<?php $_from = $this->_tpl_vars['express']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['i']):
?>
				 	<option value="<?php echo $this->_tpl_vars['i']['id']; ?>
" <?php if ($this->_tpl_vars['i']['id'] == $this->_tpl_vars['row']['express']): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['i']['name']; ?>
</option>
				<?php endforeach; endif; unset($_from); ?>	
				</select>
			</td>
		</tr>
		<tr>
			<td>二手：</td>
			<td> 
				<label><input type="radio" name="secondhand" value="1" <?php if ($this->_tpl_vars['row']['status'] == '1' || $_GET['id'] == ''): ?>checked="checked"<?php endif; ?>>是</label>
				<label><input type="radio" name="secondhand" value="0" <?php if ($this->_tpl_vars['row']['status'] == '0'): ?>checked="checked"<?php endif; ?>>否</label>
			</td>
		</tr>
		<tr>
			<td>状态：</td>
			<td> 
				<label><input type="radio" name="status" value="1" <?php if ($this->_tpl_vars['row']['status'] == '1' || $_GET['id'] == ''): ?>checked="checked"<?php endif; ?>>售卖</label>
				<label><input type="radio" name="status" value="0" <?php if ($this->_tpl_vars['row']['status'] == '0'): ?>checked="checked"<?php endif; ?>>下架</label>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td><input type="submit" name="submit" class="add_goods_submit" value="保 存"/></td>
		</tr>  
	</table> 
</form> 
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>  
<script type="text/javascript" src="<?php echo $this->_tpl_vars['__APP__']; ?>
public/js/uqcmsupload.js"></script>
<script type="text/javascript" src="<?php echo $this->_tpl_vars['__APP__']; ?>
public/js/goods_edit.js"></script>